---
title: PXF Service Host and Port
---

By default, a PXF Service started on a segment host listens on port number `5888` on `localhost`. You can configure PXF to start on a different port number, or use a different hostname or IP address. To change the default configuration, you will set one or both of the environment variables identified below:

|   Environment Variable  |  Description      |
--------------------------+--------------------
|   PXF_HOST  | The name of the host or IP address. The default host name is `localhost`.  |
|   PXF_PORT  | The port number on which the PXF Service listens for requests on the host. The default port number is `5888`.  |

Set the environment variables in the `gpadmin` user's `.bashrc` shell login file on each segment host.

<div class="note">You must restart both Greenplum Database and PXF when you configure the service host and/or port in this manner. Consider performing this configuration during a scheduled down time.</div>

## <a id="proc"></a>Procedure

Perform the following procedure to configure the PXF Service host and/or port number on one or more Greenplum Database segment hosts:

1. Log in to your Greenplum Database master node:

    ``` shell
    $ ssh gpadmin@<gpmaster>
    ```

2. For each Greenplum Database segment host:

    1. Identify the host name or IP address of the PXF Service.
    2. Identify the port number on which you want the PXF Service to run.
    3. Log in to the Greenplum Database segment host:

        ``` shell
        $ ssh gpadmin@<seghost>
        ```
    4. Open the `~/.bashrc` file in the editor of your choice.
    5. Set the `PXF_HOST` and/or `PXF_PORT` environment variables. For example, to set the PXF Service port number to 5998, add the following to the `.bashrc` file:

        ``` shell
        export PXF_PORT=5998
        ```
    4. Save the file and exit the editor.

3. Restart Greenplum Database as described in [Restarting Greenplum Database](https://gpdb.docs.pivotal.io/latest/admin_guide/managing/startstop.html#task_gpdb_restart) in the Greenplum Documentation.

4. Restart PXF on each Greenplum Database segment host as described in [Restarting PXF](cfginitstart_pxf.html#restart_pxf).

